package com.kongxx.osgistudy.springdm.helloworld;

import com.kongxx.osgistudy.springdm.user.dao.UserDAO;
import com.kongxx.osgistudy.springdm.user.model.User;

public class HelloWorld {
	private UserDAO userDAO;

	public UserDAO getUserDAO() {
		return userDAO;
	}

	public void setUserDAO(UserDAO userDAO) {
		this.userDAO = userDAO;
	}

	public void start() throws Exception {
		System.out.println("Hello Spring World!! ");
		
		for(int i = 0; i < 5; i++) {
			User user = new User();
			user.setUsername("name" + i);
			user.setPassword("password" + i);
			userDAO.addUser(user);
		}
		System.out.println(userDAO.getUsers());
	}

	public void stop() throws Exception {
		System.out.println("Goodbye Spring World!!");
	}
}
